from django.urls import path
from django.urls import re_path

from apps.users import views

urlpatterns = [
    # re_path(r'^usernames/([a-zA-Z0-9_-]{5,20})/count/$', views.UsernameCountView.as_view()),
    path("usernames/<username:username>/count/", views.UsernameCountView.as_view()),
    path("mobiles/<mobile:mobile>/count/", views.MobileCountView.as_view()),
    path("register/", views.RegisterView.as_view()),
    path('login/', views.LoginView.as_view()),
    path("logout/", views.LogoutView.as_view()),
    path("info/", views.UseInfoView.as_view()),
    path("emails/", views.EmailView.as_view()),
    path('emails/verification/', views.VerifyEmailView.as_view()),
    path("addresses/create/", views.CreateAddressView.as_view()),
    path('addresses/', views.AddressView.as_view()),
    re_path(r'^addresses/(\d+)/$', views.UpdateDestroyAddressView.as_view()),
    re_path(r"^addresses/(?P<address_id>\d+)/default/$", views.DefaultAddressView.as_view()),
    re_path('addresses/(?P<address_id>\d+)/title/', views.UpdateTitleAddressView.as_view()),
    path('password/', views.ChangePasswordView.as_view()),
    re_path(r'^browse_histories/$', views.UserBrowseHistory.as_view()),
]